import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:verse_systems/res/colors.dart';
import 'package:verse_systems/widgets/back_button.dart';

class DrawerAppbar extends StatelessWidget implements PreferredSizeWidget {
  final String? title;
  final Color color;
  final Color backgroundColor;
  final Function()? onPressed;
  final List<Widget>? actions;
  const DrawerAppbar(
      {super.key,
      this.title,
      this.color = Colours.drawer_text_color,
      this.backgroundColor = Colours.app_main_color,
      this.onPressed,
      this.actions});

  @override
  Widget build(BuildContext context) {
    return AppBar(
      backgroundColor: backgroundColor,
      title: Text(
        title ?? "",
        style: TextStyle(
            fontSize: 18.sp, fontWeight: FontWeight.normal, color: color),
      ),
      elevation: 0,
      centerTitle: true,
      leading: IosBackButton(
        color: color,
        size: 16.w,
        onPressed: onPressed,
      ),
      actions: actions,
    );
  }

  @override
  Size get preferredSize => Size.fromHeight(50.w);
}
